package com.sx.gongzhong.net;

import com.sx.gongzhong.model.BasePageListBean;
import com.sx.gongzhong.model.CommentBean;
import com.sx.gongzhong.model.LegalAdviceBean;
import com.sx.gongzhong.model.LegalAdviceTypeBean;
import com.sx.gongzhong.model.ReplyUserBean;

import java.util.List;
import java.util.Map;

import retrofit2.Call;

/**法律咨询
 * Created by admin on 2018/1/12.
 */

public class LegalAdviceManager {
    /**
     * 法律咨询 列表
     */
    public void getLegalAdviceListData(Map<String, Object> map,
                                       BaseCallBack<ReplyUserBean.BaseResult<BasePageListBean<LegalAdviceBean>>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<BasePageListBean<LegalAdviceBean>>> resultCall = service.getLegalAdviceListData(map);
        resultCall.enqueue(baseCallBack);
    }

    /**
     * 法律咨询 添加
     */
    public void addLegalAdvice(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<Void>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<Void>> resultCall = service.addLegalAdvice(map);
        resultCall.enqueue(baseCallBack);
    }

    /**
     * 法律咨询类型选择
     */
    public void getLegalTypeSelectListData(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<List<LegalAdviceTypeBean>>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<List<LegalAdviceTypeBean>>> resultCall = service.getLegalTypeSelectListData(map);
        resultCall.enqueue(baseCallBack);
    }
    /**
     * 法律咨询 详情
     */
    public void getLegalAdviceDetail(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<LegalAdviceBean>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<LegalAdviceBean>> resultCall = service.getLegalAdviceDetail(map);
        resultCall.enqueue(baseCallBack);
    }
    /**
     *法律咨询 回复列表
     */
    public void getReplayList(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<BasePageListBean<CommentBean>>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<BasePageListBean<CommentBean>>> resultCall = service.getReplayList(map);
        resultCall.enqueue(baseCallBack);
    }

    /**
     * 法律咨询 删除
     */
    public void deleteLegalAdvice(Map<String, Object> map, BaseCallBack<ReplyUserBean.BaseResult<Boolean>> baseCallBack) {
        ApiManagerService service = ServiceFactory.getInstance().createNewService(ApiManagerService.class);
        Call<ReplyUserBean.BaseResult<Boolean>> resultCall = service.deleteLegalAdvice(map);
        resultCall.enqueue(baseCallBack);
    }
}
